package demoMod.invincibleOne.powers;

import com.megacrit.cardcrawl.core.AbstractCreature;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.localization.PowerStrings;
import com.megacrit.cardcrawl.powers.AbstractPower;
import demoMod.invincibleOne.InvincibleOneMod;
import demoMod.invincibleOne.interfaces.MonsterRegenOrMaxHPApplyHook;

import java.util.UUID;

public class ExponentialGrowthPower extends AbstractPower implements MonsterRegenOrMaxHPApplyHook {
    public static final String POWER_ID = InvincibleOneMod.makeID("ExponentialGrowthPower");
    private static final PowerStrings powerStrings = CardCrawlGame.languagePack.getPowerStrings(POWER_ID);
    public static final String NAME = powerStrings.NAME;
    public static final String[] DESC = powerStrings.DESCRIPTIONS;

    public ExponentialGrowthPower(AbstractCreature owner, int amount) {
        this.owner = owner;
        this.ID = POWER_ID;
        this.name = NAME;
        this.amount = amount;
        this.priority = 10;
        this.updateDescription();
        loadRegion("painfulStabs");
    }

    @Override
    public void updateDescription() {
        this.description = String.format(DESC[0], this.amount);
    }

    @Override
    public int onHeal(int healAmount) {
        this.flash();
        return (int)(healAmount * (1.0F + amount / 100.0F));
    }

    @Override
    public float onRegenApply(AbstractCreature target, float regenAmount) {
//        if (target == owner) {
//            return regenAmount * (1.0F + amount / 100.0F);
//        }
        return regenAmount;
    }

    @Override
    public float onMaxHpIncreased(AbstractCreature target, float maxHpGained) {
        if (target == owner) {
            return maxHpGained * (1.0F + amount / 100.0F);
        }
        return maxHpGained;
    }
}
